<route lang="json5" type="page">
{
  layout: 'default',
  style: {
    navigationBarTitleText: '成品库存查询',
    navigationStyle: 'custom',
  },
}
</route>
<template>
  <PageLayout navTitle="成品库存查询" backRouteName="index" routeMethod="pushTab">
    <!-- <h1>成品油库页面正在开发中</h1> -->
    <wd-segmented :options="segmentedList" v-model:value="segmentedCurrent"></wd-segmented>
    <view v-if="segmentedCurrent === '暂存库'">
      <temp-storage></temp-storage>
    </view>
    <view v-else>
      <final-storage></final-storage>
    </view>
  </PageLayout>
</template>

<script setup lang="ts">
import { useUserStore } from '@/store/user'
import finalStorage from './components/finalStorage.vue'
import TempStorage from './components/tempStorage.vue'

defineOptions({
  name: 'inventory',
  options: {
    styleIsolation: 'shared',
  },
})

const userStore = useUserStore()
const isGrows = computed(() => {
  if (userStore.userInfo.userRoleName.includes('种植户')) {
    return true
  } else {
    return false
  }
})
const segmentedList = computed(() => {
  // 暂时返回所有

  return ['暂存库', '成品库']

  // if (isGrows.value) {
  //   return ['暂存库']
  // } else {
  //   return ['暂存库', '成品库']
  // }
})
const segmentedCurrent = ref('暂存库')

console.log('当前用户', isGrows.value ? '就是' : '不是', '种植户 ')
</script>

<style lang="scss" scoped></style>
